<HTML>
<HEAD>
<TITLE>g_analyze</TITLE>
<LINK rel=stylesheet href="style.css" type="text/css">
<BODY text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990000" alink="#FF0000">
<TABLE WIDTH="98%" NOBORDER >
<TR><TD WIDTH=400>
<TABLE WIDTH=400 NOBORDER>
<TD WIDTH=116>
<a href="http://www.gromacs.org/"><img SRC="../images/gmxlogo_small.png"BORDER=0 </a></td>
<td ALIGN=LEFT VALIGN=TOP WIDTH=280><br><h2>g_analyze</h2><font size=-1><A HREF="../online.html">Main Table of Contents</A></font><br><br></td>
</TABLE></TD><TD WIDTH="*" ALIGN=RIGHT VALIGN=BOTTOM><p><B>VERSION 4.5<br>
Thu 26 Aug 2010</B></td></tr></TABLE>
<HR>
<H3>Description</H3>
<p>
g_analyze reads an ascii file and analyzes data sets.
A line in the input file may start with a time
(see option <tt>-time</tt>) and any number of y values may follow.
Multiple sets can also be
read when they are separated by & (option <tt>-n</tt>),
in this case only one y value is read from each line.
All lines starting with # and @ are skipped.
All analyses can also be done for the derivative of a set
(option <tt>-d</tt>).<p>
All options, except for <tt>-av</tt> and <tt>-power</tt> assume that the
points are equidistant in time.<p>
g_analyze always shows the average and standard deviation of each
set. For each set it also shows the relative deviation of the third
and fourth cumulant from those of a Gaussian distribution with the same
standard deviation.<p>
Option <tt>-ac</tt> produces the autocorrelation function(s).<p>
Option <tt>-cc</tt> plots the resemblance of set i with a cosine of
i/2 periods. The formula is:<br>2 (int0-T y(t) cos(i pi t) dt)^2 / int0-T y(t) y(t) dt<br>
This is useful for principal components obtained from covariance
analysis, since the principal components of random diffusion are
pure cosines.<p>
Option <tt>-msd</tt> produces the mean square displacement(s).<p>
Option <tt>-dist</tt> produces distribution plot(s).<p>
Option <tt>-av</tt> produces the average over the sets.
Error bars can be added with the option <tt>-errbar</tt>.
The errorbars can represent the standard deviation, the error
(assuming the points are independent) or the interval containing
90% of the points, by discarding 5% of the points at the <a href="top.html">top</a> and
the bottom.<p>
Option <tt>-ee</tt> produces error estimates using block averaging.
A set is divided in a number of blocks and averages are calculated for
each block. The error for the total average is calculated from
the variance between averages of the m blocks B_i as follows:
error^2 = Sum (B_i - &lt;B&gt;)^2 / (m*(m-1)).
These errors are plotted as a function of the block size.
Also an analytical block average curve is plotted, assuming
that the autocorrelation is a sum of two exponentials.
The analytical curve for the block average is:<br>
f(t) = sigma sqrt(2/T (  a   (tau1 ((exp(-t/tau1) - 1) tau1/t + 1)) +<br>
                       (1-a) (tau2 ((exp(-t/tau2) - 1) tau2/t + 1)))),<br>where T is the total time.
a, tau1 and tau2 are obtained by fitting f^2(t) to error^2.
When the actual block average is very close to the analytical curve,
the error is sigma*sqrt(2/T (a tau1 + (1-a) tau2)).
The complete derivation is given in
B. Hess, J. Chem. Phys. 116:209-217, 2002.<p>
Option <tt>-bal</tt> finds and subtracts the ultrafast "ballistic"
component from a hydrogen bond autocorrelation function by the fitting
of a sum of exponentials, as described in e.g.
O. Markovitch, J. Chem. Phys. 129:084505, 2008. The fastest term
is the one with the most negative coefficient in the exponential,
or with <tt>-d</tt>, the one with most negative time derivative at time 0.
<tt>-nbalexp</tt> sets the number of exponentials to fit.<p>
Option <tt>-gem</tt> fits bimolecular rate constants ka and kb
(and optionally kD) to the hydrogen bond autocorrelation function
according to the reversible geminate recombination model. Removal of
the ballistic component first is strongly adviced. The model is presented in
O. Markovitch, J. Chem. Phys. 129:084505, 2008.<p>
Option <tt>-filter</tt> prints the RMS high-frequency fluctuation
of each set and over all sets with respect to a filtered average.
The filter is proportional to cos(pi t/len) where t goes from -len/2
to len/2. len is supplied with the option <tt>-filter</tt>.
This filter reduces oscillations with period len/2 and len by a factor
of 0.79 and 0.33 respectively.<p>
Option <tt>-g</tt> fits the data to the function given with option
<tt>-fitfn</tt>.<p>
Option <tt>-power</tt> fits the data to b t^a, which is accomplished
by fitting to a t + b on <a href="log.html">log</a>-<a href="log.html">log</a> scale. All points after the first
zero or negative value are ignored.<p>Option <tt>-luzar</tt> performs a Luzar & Chandler kinetics analysis
on output from <tt><a href="g_hbond.html">g_hbond</a></tt>. The input file can be taken directly
from <tt><a href="g_hbond.html">g_hbond</a> -ac</tt>, and then the same result should be produced.
<P>
<H3>Files</H3>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>
<TR><TH>option</TH><TH>filename</TH><TH>type</TH><TH>description</TH></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-f</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">   graph.xvg</a></tt> </TD><TD> Input </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-ac</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">autocorr.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-msd</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">     msd.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-cc</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html"> coscont.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-dist</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">   distr.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-av</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html"> average.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-ee</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">  errest.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-bal</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="xvg.html">ballisitc.xvg</a></tt> </TD><TD> Output, Opt. </TD><TD> xvgr/xmgr file </TD></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-g</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="log.html">  fitlog.log</a></tt> </TD><TD> Output, Opt. </TD><TD> Log file </TD></TR>
</TABLE>
<P>
<H3>Other options</H3>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>
<TR><TH>option</TH><TH>type</TH><TH>default</TH><TH>description</TH></TR>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]h</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Print help info and quit </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]version</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Print version info and quit </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-nice</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>0</tt> </TD><TD> Set the nicelevel </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]w</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> View output <a href="xvg.html">xvg</a>, <a href="xpm.html">xpm</a>, <a href="eps.html">eps</a> and <a href="pdb.html">pdb</a> files </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-xvg</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>xmgrace</tt> </TD><TD> <a href="xvg.html">xvg</a> plot formatting: <tt>xmgrace</tt>, <tt>xmgr</tt> or <tt>none</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]time</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>yes   </tt> </TD><TD> Expect a time in the input </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-b</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>-1    </tt> </TD><TD> First time to read from set </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-e</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>-1    </tt> </TD><TD> Last time to read from set </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-n</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>1</tt> </TD><TD> Read # sets separated by & </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]d</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Use the derivative </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-bw</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>0.1   </tt> </TD><TD> Binwidth for the distribution </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-errbar</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>none</tt> </TD><TD> Error bars for -av: <tt>none</tt>, <tt>stddev</tt>, <tt>error</tt> or <tt>90</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]integrate</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Integrate data function(s) numerically using trapezium rule </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-aver_start</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Start averaging the integral from here </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]xydy</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Interpret second data set as error in the y values for integrating </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]regression</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Perform a linear regression analysis on the data. If -xydy is set a second set will be interpreted as the error bar in the Y value. Otherwise, if multiple data sets are present a multilinear regression will be performed yielding the constant A that minimize chi^2 = (y - A0 x0 - A1 x1 - ... - AN xN)^2 where now Y is the first data set in the input file and xi the others. Do read the information at the option <tt>-time</tt>. </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]luzar</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Do a Luzar and Chandler analysis on a correlation function and related as produced by <a href="g_hbond.html">g_hbond</a>. When in addition the -xydy flag is given the second and fourth column will be interpreted as errors in c(t) and n(t). </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-temp</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>298.15</tt> </TD><TD> Temperature for the Luzar hydrogen bonding kinetics analysis </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-fitstart</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>1     </tt> </TD><TD> Time (ps) from which to start fitting the correlation functions in order to obtain the forward and backward rate constants for HB breaking and formation </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-fitend</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>60    </tt> </TD><TD> Time (ps) where to stop fitting the correlation functions in order to obtain the forward and backward rate constants for HB breaking and formation. Only with -gem </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-smooth</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>-1    </tt> </TD><TD> If &gt;= 0, the tail of the ACF will be smoothed by fitting it to an exponential function: y = A exp(-x/tau) </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-filter</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Print the high-frequency fluctuation after filtering with a cosine filter of length # </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]power</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Fit data to: b t^a </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]subav</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>yes   </tt> </TD><TD> Subtract the average before autocorrelating </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]oneacf</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Calculate one ACF over all sets </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-acflen</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>-1</tt> </TD><TD> Length of the ACF, default is half the number of frames </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-[no]normalize</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>yes   </tt> </TD><TD> Normalize ACF </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-P</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>0</tt> </TD><TD> Order of Legendre polynomial for ACF (0 indicates none): <tt>0</tt>, <tt>1</tt>, <tt>2</tt> or <tt>3</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-fitfn</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>none</tt> </TD><TD> Fit function: <tt>none</tt>, <tt>exp</tt>, <tt>aexp</tt>, <tt>exp_exp</tt>, <tt>vac</tt>, <tt>exp5</tt>, <tt>exp7</tt> or <tt>exp9</tt> </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-ncskip</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>0</tt> </TD><TD> Skip N points in the output file of correlation functions </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-beginfit</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Time where to begin the exponential fit of the correlation function </TD></TD>
<TR><TD ALIGN=RIGHT> <b><tt>-endfit</tt></b> </TD><TD ALIGN=RIGHT> real </TD><TD ALIGN=RIGHT> <tt>-1    </tt> </TD><TD> Time where to end the exponential fit of the correlation function, -1 is until the end </TD></TD>
</TABLE>
<P>
<hr>
<div ALIGN=RIGHT>
<font size="-1"><a href="http://www.gromacs.org">http://www.gromacs.org</a></font><br>
<font size="-1"><a href="mailto:gromacs@gromacs.org">gromacs@gromacs.org</a></font><br>
</div>
</BODY>
